package day03;

/*
    赋值运算符：
        1）简单赋值运算符：=
        2）扩展赋值运算符：+=、-=、*=、/=、%=、
        注意：扩展赋值运算符自带强转功能
 */
public class Demo04赋值运算符 {
    public static void main(String[] args) {

        short a = 5;
        a += 10;//相当于a=(short)(a=a+10);
        System.out.println(a);//a=15
        a /= 5;//相当于a=(short)(a=a/5)
        System.out.println(a);//a=3
        a *= 4;//相当于a=(short)(a=a*4)
        System.out.println(a);//a=12
        a += 12;//相当于a=(short)(a=a+12)
        System.out.println(a);//a=24
        a %= 5;//相当于a=(short)(a=a%5)
        System.out.println(a);//a=4
    }
}
